import { listGen } from '@/api/system/gen'

const gen = {
  state: {
    genitem: [2,3],
    gentotal: 0
  },

  mutations: {
    GEN_LIST: (state, data) => {
      state.genitem = data.rows;
      state.genitem = data.total;
    },
  },

  actions: {
    // 登录
    Genlist({ commit }, data) {
      console.log(data)
      // const username = userInfo.username.trim()
      // const password = userInfo.password
      // const code = userInfo.code
      // const uuid = userInfo.uuid
      return new Promise((resolve, reject) => {
        listGen().then(res => {
          commit('GEN_LIST', res)
          resolve()
        }).catch(error => {
          reject(error)
        })
      })
    },
  }
}

export default gen
